package com.baiyue.entity;

import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotations.Version;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.validation.annotation.Validated;

/**
 *
 * @author 伍波
 * @date 2024-05-22
 */
@Data
@TableName("charging")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Validated
public class Charging implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 每个计费记录的唯一标识符
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 计费开始时间
     */
    @TableField("start_time")
    private Date startTime;
    /**
     * 开单人
     */
    private String operator;
    /**
     * 顾客人数
     */
    @TableField("customer_count")
    private Integer customerCount;
    /**
     * 包间号
     */
    @TableField("room_number")
    private String roomNumber;
    /**
     * 暂停计费开始时间
     */
    @TableField("pause_start_time")
    private Date pauseStartTime;
    /**
     * 暂停计费结束时间
     */
    @TableField("pause_end_time")
    private Date pauseEndTime;
    /**
     * 状态 0-空闲，1-开启，2-暂停计费,3-已结束
     */
    private Integer status;

    /**
     * 数据唯一标识
     */
    private String uuid;
    /**
     * 计费规则id
     */
    @TableField("toll_rules")
    private Integer tollRules;

    /**
     * 暂停计费分钟数
     */
    @TableField("pause_minutes")
    private Integer pauseMinutes;

    /**
     * 结束计费时间
     */
    @TableField("stop_time")
    private Date stopTime;
    /**
     * 开始时间
     */
    @TableField(exist = false)
    private String start;

    /**
     * 结束时间
     */
    @TableField(exist = false)
    private String end;

    /**
     * 排序字段
     */
    @TableField(exist = false)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String sortField;

    /**
     * 排序顺序
     * desc  asc
     */
    @TableField(exist = false)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String sortValue;

    public Charging(Date startTime, String operator, Integer customerCount, String roomNumber, Date pauseStartTime,
                    Date pauseEndTime, Integer status, String start, String end, String sortField, String sortValue,
                    String uuid, Integer tollRules,Integer pauseMinutes) {
        this.startTime = startTime;
        this.operator = operator;
        this.customerCount = customerCount;
        this.roomNumber = roomNumber;
        this.pauseStartTime = pauseStartTime;
        this.pauseEndTime = pauseEndTime;
        this.status = status;
        this.start = start;
        this.end = end;
        this.sortField = sortField;
        this.sortValue = sortValue;
        this.uuid = uuid;
        this.tollRules = tollRules;
        this.pauseMinutes = pauseMinutes;
    }
}
